﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using _MetalSlug.MyCharacters.Characters;
using _MetalSlug.Soldiers.Units;
using _MetalSlug.Mission;

namespace _MetalSlug.Weapons.Units
{
    public class Bullet : VisibleGameEntity
    {
        protected Vector2 startPosition;

        public Vector2 StartPosition
        {
            get { return startPosition; }
            set { startPosition = value; }
        }
        protected Vector2 speed;

        public Vector2 Speed
        {
            get { return speed; }
            set { speed = value; }
        }
        protected Vector2 direction;

        public Vector2 Direction
        {
            get { return direction; }
            set { direction = value; }
        }

        protected Boolean visible;

        public Boolean Visible
        {
            get { return visible; }
            set { visible = value; }
        }


        protected MySprite spriteBullet;

        public MySprite SpriteBullet
        {
            get { return spriteBullet; }
            set { spriteBullet = value; }
        }

        public enum TYPE_BULLET
        {
            AK_BULLET,
            BAZOKA_BULLET,
            MINIGUN_BULLET,
            BOOM_BULLET,
            BOOMHELI_BULLET,
            SHOTGUN_BULLET
        }

        protected TYPE_BULLET type;

        public TYPE_BULLET Type
        {
            get { return type; }
            set { type = value; }
        }

        public virtual void InitialAttribute(Vector2 topleft, Vector2 size, Vector2 _Speed)
        {
            Sprites = new List<MySprite>();
            TopLeft = topleft;
            Size = size;
            Speed = _Speed;
            LoadContent();
            NSpirtes = Sprites.Count;
        }

        public override void Draw(SpriteBatch spriteBatch)
        {
            base.Draw(spriteBatch);
        }
        public virtual Vector2 Move(KeyboardState keyBoardState, Vector2 ufo, int speed)
        {
            if (keyBoardState.IsKeyDown(Keys.A))
            {
                ufo.X += speed;
            }
            if (keyBoardState.IsKeyDown(Keys.D))
            {
                ufo.X -= speed;
            }
            return ufo;
        }

        public virtual void Update(GameTime gameTime, MyMap map, MyCharacter Hero)
        {
          // base.Update(gameTime);
        }

        public virtual void Update(GameTime gameTime, List<Enemy> enemies)
        {

        }

        public virtual void LoadContent()
        {
        }

        public virtual void Fire(Vector2 theStartPosition, Vector2 theDirection)
        {

        }

        public virtual Bullet Clone()
        {
            return null;
        }

        public virtual void Copy(Bullet Origin)
        {
            TopLeft = Origin.TopLeft;
            Size = Origin.Size;
            Sprites = Origin.Sprites;
            NSpirtes = Origin.NSpirtes;
            Speed = Origin.Speed;
            Type = Origin.Type;
            Visible = true;
        }

        
    }
}
